package com.hsd.whb.repository;

import com.hsd.whb.entity.Manager;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ManagerRepository extends JpaRepository<Manager, Integer> {

    Manager findByUsername(String username);

    Manager findByPhone(String phone);

    Manager findByEmail(String email);

    Manager findByEnterpriseAddress(String address);

    Manager findByEnterpriseCode(String code);

    List<Manager> findByUsernameLikeAndDeleted(String username, Integer deleted);

    @Query("select id from Manager where username like %?1% ")
    List<Integer> findIdByUsernameLike(String username);
}
